﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Database.Model.TechnicRequestsExt>" %>
<%--<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Models.TechnicRequestsExt>" %>--%>
<%@ Import Namespace="CRM.Resourses" %>

<%
    var addressesCol = new CRM.Database.Model.AddressesCollection();
%>

<%
    Html.DevExpress().ComboBox(settings =>
    {
        settings.Name = "IdAddress";
        settings.CallbackRouteValues = new { Controller = "TD", Action = "TechnicRequestAddressesPartial", key = Model.Key };
        settings.Width = 496;
        settings.Properties.EnableCallbackMode = true;
        settings.Properties.ValueField = "IdAddress";
        settings.Properties.ValueType = typeof(int);
        //settings.Properties.Columns.Add("RegionNameLocalized", Resourses.Name, Unit.Percentage(25));
        //settings.Properties.Columns.Add("DistrictNameLocalized", Resourses.Phone, Unit.Percentage(25));
        //settings.Properties.Columns.Add("AreasNameLocalized", Resourses.Email, Unit.Percentage(25));
        //settings.Properties.Columns.Add("CityExt", Resourses.Email, Unit.Percentage(25));
        //settings.Properties.Columns.Add("Street", Resourses.Email, Unit.Percentage(25));
        //settings.Properties.Columns.Add("House", Resourses.Email, Unit.Percentage(25));
        //settings.Properties.Columns.Add("Phone", Resourses.Email, Unit.Percentage(25));
        settings.Properties.Columns.Add("RegionNameLocalized", Resourses.customerRegion);
        settings.Properties.Columns.Add("DistrictNameLocalized", Resourses.customerDistrict);
        settings.Properties.Columns.Add("AreasNameLocalized", Resourses.customerArea);
        settings.Properties.Columns.Add("SettlementsLocalized", Resourses.customerCity);
        settings.Properties.Columns.Add("Street", Resourses.customerStreet);
        settings.Properties.Columns.Add("House", Resourses.customerHouse);
        settings.Properties.Columns.Add("Phone", Resourses.customerPhone);
        settings.Properties.DropDownWidth = 496;
        settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
        settings.Properties.ClientSideEvents.BeginCallback = "function(s, e) { e.customArgs['LE'] = IdLegalEntity.GetValue(); }";
    }).BindList(addressesCol.GetAddressesByLegalEntityId(Model.IdLegalEntity)).Bind(Model.IdAddress).GetHtml();
    //}).BindList(DB.GetAddressesByLegalEntityId(Model.IdLegalEntity)).Bind(Model.IdAddress).GetHtml();
%>